<?php
Helper::register("jquery-1.8.1.min.js");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="language" content="en" />

    <!-- blueprint CSS framework -->
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" />
    <!--[if lt IE 8]>
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
    <![endif]-->

    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />
    <script type="text/javascript">
        function SingIn(){
            var account = $("#account_z").val();
            var pass = $("#pass_z").val();
            if ( account == "" || pass == "") {
                $("#ss").html("Account or Password is invalid.");
                return false;
            }
            $.get("<?php echo $this->createUrl("/member/SignIn"); ?>",{ account :account , pass : pass} ,
                    function(data){
                        console.log(data);
                        window.location.href = "<?php echo Yii::app()->createUrl("/member/");?>"
                    });
        }

        function SingOut() {
            $.get("<?php echo $this->createUrl("/member/SignOut"); ?>",
                    function(data){
                        if ( data == 1 ) {
                            window.location.href = "<?php echo Yii::app()->createUrl("/");?>"
                            return false;
                        }
                    });
        }
    </script>
    <title>Aion Xenia : The Private Server Aion MMORPG Website</title>
</head>

<body>

<div class="container" id="page">

    <div id="header">
        <div id="header_bar">
            <?php
            $gs = Helper::GameServerStatus();
            $ls = Helper::LoginServerStatus();
            $elyos = Helper::ElyosOnline();
            $ASMODIANS = Helper::AsmodiansOnline();
            echo "Game Server :  $gs | Login Server : $ls | Elyos Online : $elyos | Asmodians :  $ASMODIANS";
            ?>
        </div>
        <div id="logo"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/logo.png"></div>
    </div><!-- header -->

    <div id="mainmenu">
        <ul>
            <li><a href="<?php echo $this->createUrl("/")?>">Home</a></li>
            <li><a href="http://xenia.no-ip.biz/bbs/read.php?tid=1" target="_blank">Features </a></li>
            <li><a href="http://xenia.no-ip.biz/bbs/thread.php?fid=3" target="_blank">Event</a></li>
            <li><a href="<?php echo $this->createUrl("/site/Download")?>">Download</a></li>
            <li><a href="http://xenia.no-ip.biz/aion/" target="_blank">Forums</a></li>
            <li><a href="#">Guide</a></li>
            <li><a href="#">About</a></li>
        </ul>
    </div><!-- mainmenu -->
    <div >
        <div style="width: 700px;float: left;">
            <?php echo $content; ?>
        </div>

        <div style="padding: 20px;float: left;">
            <div class="box_right">
                <div class="box_right_head">Member Zone</div>

                <?php if ( Yii::app()->user->isGuest ) {  ?>
                <input type="type" name="account_z" id="account_z" class="twitterStyleTextbox" placeholder="account">
                <input type="password" name="pass_z" id="pass_z" class="twitterStyleTextbox" placeholder="password">
                <div id="ss"></div>
                <button class="clean-gray" ONCLICK="window.location.href='<?php echo $this->createUrl("/member/Signup"); ?>'">Sign up</button>
                <button class="clean-gray" onclick="SingIn();">Sign in</button>
                <?php } else {
                $userInfo = Yii::app()->user->getState("userInfo");
                //print_r($userInfo);
                $toll_icon = Yii::app()->request->baseUrl."/images/credits_32x32.png";
                echo <<<HTML
                                        <div id="welcome_account">welcome : {$userInfo['name']} , <img src="$toll_icon" id="toll_icon"> {$userInfo['credits']}</div>
                                        <div >
                                        <ul class="account_li">
                                            <li><a href="{$this->createUrl("/member/")}">- Dashboard</a> </li>
                                            <li><a href="#">- Account</a></li>
                                            <li><a href="#">- Character</a></li>
                                            <li><a href="#">- Donate</a></li>
                                        </ul>
                                        </div>
                                        <button class="clean-gray" onclick="SingOut();">Sign Out</button>
HTML;

            }?>
            </div>


            <div class="box_right">
                <div class="box_right_head">Serve Rate</div>
                <li>exp : 10x</li>
                <li>drop : 10x</li>
            </div>

            <div class="box_right">
                <div class="box_right_head">Player Commands</div>
                <li>//goto</li>
                <li>//announce</li>
                <li>//movetonpc</li>
                <li>//moveto</li>
                <li>//givemissingskills</li>
            </div>
        </div>

    </div>


    <div class="clear"></div>

    <div id="footer">
        Copyright &copy; <?php echo date('Y'); ?> <?php echo CHtml::encode(Yii::app()->name); ?>  All Rights Reserved. ( Powered by Aion finish Core Dev team )
    </div><!-- footer -->

</div><!-- page -->

</body>
</html>